void print(int n)
{
	int t = 1;
	int a[100][100] = { 0 };
	for (int i = 0; i < n; i++)
	{
		for (int j = 1; j <= n * 2 + 1; j++)
		{
			if (j == n + 1 && i == 0)
			{
				printf("%2d", t);
				a[i][j] = t;
			}
			else if (i == 0)
			{
				printf("  ");
				a[i][j] = 0;
			}
			else
			{
				if (a[i - 1][j - 1] + a[i - 1][j + 1] != 0)
				{
					printf("%2d", a[i - 1][j - 1] + a[i - 1][j + 1]);
					a[i][j] = a[i - 1][j - 1] + a[i - 1][j + 1];
				}
				else
				{
					printf("  ");
					a[i][j] = 0;
				}

			}
		}
		printf("\n");
	}
}
#include<stdio.h>
int main()
{
	int x = 9;
	print(x);
	return 0;
}